package com.mlf.abstractFactory.spring.peripheral;

import com.mlf.abstractFactory.demo.peripheral.PeripheralFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
public class PeripheralController {
    @Autowired
    private PeripheralFactory productFactory;

    @GetMapping("/peripheral")
    public String getPeripheral() {
        log.info(productFactory.createKeyboard().getDescription());
        log.info(productFactory.createMouse().getDescription());
        return "ok";
    }

}
